import Mock from "mockjs";
export default [
  // GetUserInfo
  {
    url: "/upms/user/info",
    type: "get",
    response: () => {
      return {
        code: 200,
        msg: "成功",
        data: {
          name: "testName",
        },
      };
    },
  },
  // GetToken
  {
    url: "/login",
    type: "post",
    response: (option: any) => {
      const $username = JSON.parse(option.body).username;
      const $password = JSON.parse(option.body).password;
      if ($username==='admin' && $password==='123') {
        return Mock.mock({
          code: 200,
          msg: "成功",
          data: {
            token: "testToken",
          },
        });
      } else {
        return Mock.mock({
          code: 400,
          msg: "账号密码错误",
        });
      }
    },
  },
];
